<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        th,
        td {
            width: 200px;
            border: 1px solid black
        }
        .aa{
            color: red;
        }
        thead tr{
            background-image: linear-gradient(to top,orange,red);
        }
        tbody tr{
            background-image: linear-gradient(to right,yellow,skyblue);
        }
        tbody tr:hover{
            background-image: linear-gradient(to right,skyblue,green);
        }
    </style>
</head>

<body>
    <table>
        <thead>
            <tr>
                <th>姓名</th>
                <th>科目</th>
                <th>成绩</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody  align="center">

        </tbody>
    </table>
</body>

</html>
<script>
    var data = [
        {
            'xm': '古月方源',
            'km': '蛊修',
            'cj': 60,
        },
        {
            'xm': '白凝冰',
            'km': '蛊修',
            'cj': 100,
        },
        {
            'xm': '古月方正',
            'km': '蛊修',
            'cj': 100,
        },
        {
            'xm': '马鸿运',
            'km': '蛊修',
            'cj': 100,
        }
    ]
    var tb=document.querySelector("tbody")
    for(i=0;i<data.length;i++){
        var tr=document.createElement("tr")
        tr.innerHTML=`
                <td>${data[i]['xm']}</td>
                <td>${data[i]['km']}</td>
                <td class='aa'>${data[i]['cj']}</td>
                <td><a href="#">删除</a></td>`;
        tb.appendChild(tr)
    }
</script>